package com.zhou.org.common;

import com.zhou.util.FileUtil;
import com.zhou.util.StringTool;
import com.zhou.framework.config.SystemConfig;

/**
 * @author lang.zhou
 * @since 2023/3/5
 */
public class AttachmentUtil {

    public static String getAvatar(String relativeAvatar){
        String avatar = null;
        if(StringTool.isNotBlank(relativeAvatar)){
            if(!StringTool.isHttp(relativeAvatar)){
                avatar = FileUtil.formatFilePath(SystemConfig.getInstance().getRoot()) + relativeAvatar;
            }else{
                avatar = relativeAvatar;
            }
        }
        return avatar;
    }
}
